//Base64编码：用64个字符表示任意二进制数据的方法

map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='  //Base64码表
map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_='  //安全Base64码表 +号无法在url会变成空格
let CruptoJS = require('./CryptoJS');
let wordArray= CruptoJS.enc.Utf8.parse('luojinsheng');  //解析 UTF-8 编码的字符串
console.log(wordArray);
let base64 = CruptoJS.enc.Base64.stringify(wordArray);
console.log(base64);

let b64_wordArray = CruptoJS.enc.Base64.parse(base64)
let hex = CruptoJS.enc.Hex.stringify(b64_wordArray)
console.log(hex);


// 将普通字符串编码为 Base64
let plainText = "luojinsheng";
let base64Encoded = btoa(plainText);
console.log("Base64 编码后的字符串: " + base64Encoded);

// 将 Base64 编码的字符串解码为普通字符串
let decodedPlainText = atob(base64Encoded);
console.log("解码后的字符串: " + decodedPlainText);





